<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>A4尺寸文档</title>
    <style>
      @font-face {
        font-family: "msyh";
        font-style: normal;
        font-weight: normal;
        src: url("/fonts/msyh.ttf") format("truetype");
      }

      body {
        font-family: "msyh";
        margin: 0;
        padding: 0;
      }

      @page {
        size: A4;
        margin: 0 0 0;
      }

      .container {
        width: 210mm;
        border-right: 1px solid #f2f2f2;
      }

      .head {
        width: 36%;
        margin: 10mm auto;
        gap: 3mm;
      }

      .head .logo {
        float: left;
        margin-right: 3mm;
      }

      .head::after {
        clear: both;
        display: block;
        content: " ";
      }

      .title,
      .subtitle {
        text-align: center;
        font-size: 18px;
        font-weight: bold;
      }

      .container > .title {
        margin-top: 10mm;
      }

      .table {
        width: 90%;
        margin: 10mm auto;
        border-collapse: collapse;
      }

      .table td,
      .table th {
        padding: 2mm 4mm;
        border: 1px solid #ccc;
      }

      .table th {
        text-align: left;
        background-color: #efefef;
      }

      .tips {
        width: 90%;
        margin: 10mm auto;
        border: 1px solid #ccc;
      }

      .tips .content {
        margin: 5mm;
      }

      .tips .title {
        margin: 0;
        text-align: left;
        font-size: 5mm;
      }

      .tips p {
        font-size: 14px;
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="head">
        <img src="{$img}" class="logo" />
        <div style="float: left">
          <div class="title">正中能源（广东）有限公司</div>
          <div class="subtitle">交易结算单</div>
        </div>
      </div>
      <table class="table">
        <colgroup>
          <col width="20%" />
          <col width="40%" />
          <col width="40%" />
        </colgroup>
        <tr>
          <th colspan="3">业务员公司A</th>
        </tr>
        <tr>
          <td>编号：{$customer.id}</td>
          <td>交易月份：{$tradeMonth}</td>
          <td>交易用户：{$customerCount}户</td>
        </tr>
      </table>
      <table class="table">
        <colgroup>
          <col width="60%" />
          <col width="20%" />
          <col width="20%" />
        </colgroup>
        <tr>
          <th colspan="3">收益明细</th>
        </tr>
        <tr>
          <th>客户</th>
          <th>电量(万千瓦时)</th>
          <th>收益(元)</th>
        </tr>
        {foreach $customers as $key=>$item }
        <tr>
          <td>{$item.customerName}</td>
          <td>{$item.electricity}</td>
          <td>{$item.amount}</td>
        </tr>
        {/foreach}
        <tr>
          <td>汇总</td>
          <td>{$customer.electricityTotal}</td>
          <td>{$customer.amount}</td>
        </tr>
      </table>
      <table class="table">
        <colgroup>
          <col width="80%" />
          <col width="20%" />
        </colgroup>
        <tr>
          <th colspan="2">本期汇总(元)</th>
        </tr>
        <tr>
          <td>本期总收益</td>
          <td>{$customer.amount}</td>
        </tr>
        <tr>
          <td>本期开票金额</td>
          <td>{$invoiceAmount}</td>
        </tr>
      </table>
      <div class="tips">
        <div class="content">
          <div class="title">温馨提示：</div>
          <p>1、以上数据均为暂定收益及金额，具体以双方《售电业务代理服务合作协议》的约定为准。</p>
          <p>2、未经我司许可，贵公司不得向第三方提供(披露)结算单的相关内容，否则我司有权追究贵公司相关责任。</p>
          <p>3、如确认无误请按照结算单上的开票金额进行开票，我司收到发票则视为贵司已确认结算单数据无误。</p>
          <p>4、如有疑问，请联系业务经理或客服,客服电话:400-8118933。</p>
        </div>
      </div>
    </div>
  </body>
</html>
